Skip to content

Conversation

@spuchin
Copy link
Collaborator

@spuchin spuchin commented Aug 7, 2025

Changelog entry

...

Changelog category

  • Documentation(changelog entry is not required)

Description for reviewers

...

@spuchin spuchin requested a review from a team as a code owner August 7, 2025 16:31
@spuchin spuchin changed the title First version of docs for query execution concepts. Documentation for query execution concepts. Aug 7, 2025
@github-actions
Copy link

github-actions bot commented Aug 7, 2025

2025-08-07 16:34:43 UTC Pre-commit check linux-x86_64-relwithdebinfo for daa32b2 has started.
2025-08-07 16:34:56 UTC Artifacts will be uploaded here
2025-08-07 16:37:21 UTC ya make is running...
🟢 2025-08-07 16:37:27 UTC Tests successful.

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-08-07 16:37:33 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Aug 7, 2025

2025-08-07 16:34:52 UTC Pre-commit check linux-x86_64-release-asan for daa32b2 has started.
2025-08-07 16:35:05 UTC Artifacts will be uploaded here
2025-08-07 16:37:27 UTC ya make is running...
🟢 2025-08-07 16:37:32 UTC Tests successful.

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-08-07 16:37:38 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Aug 7, 2025

🔴 2025-08-11 02:01:58 UTC The validation of the Pull Request description has failed. Please update the description.

Invalid Changelog category: Documentation(changelog entry is not required)

@github-actions
Copy link

github-actions bot commented Aug 7, 2025

✅ Documentation build

Revision built successfully
Revision preview link

Build logs

Warnings (1)

⚠️ Variable YQL not found in en/concepts/query_execution.md

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

2025-08-08 08:56:38 UTC Pre-commit check linux-x86_64-release-asan for a9e12e5 has started.
2025-08-08 08:56:52 UTC Artifacts will be uploaded here
2025-08-08 08:59:13 UTC ya make is running...
🟢 2025-08-08 08:59:19 UTC Tests successful.

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-08-08 08:59:27 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

2025-08-08 08:56:38 UTC Pre-commit check linux-x86_64-relwithdebinfo for a9e12e5 has started.
2025-08-08 08:56:55 UTC Artifacts will be uploaded here
2025-08-08 08:59:25 UTC ya make is running...
🟢 2025-08-08 08:59:30 UTC Tests successful.

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-08-08 08:59:37 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

✅ Documentation build

Revision built successfully
Revision preview link

@github-actions github-actions bot added documentation Improvements or additions to documentation and removed not-for-changelog labels Aug 11, 2025
@ydbot
Copy link
Collaborator

ydbot commented Aug 11, 2025

Hey , it has been 38 business-hours since the author's last update, could you please review?

@ydbot
Copy link
Collaborator

ydbot commented Aug 12, 2025

Hey @lopatinevgeny, it has been 68 business-hours since the author's last update, could you please review?

@ydbot
Copy link
Collaborator

ydbot commented Aug 13, 2025

Hey @lopatinevgeny, it has been 98 business-hours since the author's last update, could you please review?

@ydbot
Copy link
Collaborator

ydbot commented Aug 15, 2025

Hey @lopatinevgeny, it has been 128 business-hours since the author's last update, could you please review?

@ydbot
Copy link
Collaborator

ydbot commented Aug 18, 2025

Hey @lopatinevgeny, it has been 152 business-hours since the author's last update, could you please review?

@ydbot
Copy link
Collaborator

ydbot commented Aug 19, 2025

Hey @lopatinevgeny, it has been 182 business-hours since the author's last update, could you please review?

@github-actions
Copy link

github-actions bot commented Aug 19, 2025

2025-08-19 11:10:10 UTC Pre-commit check linux-x86_64-release-asan for 667e712 has started.
2025-08-19 11:10:38 UTC Artifacts will be uploaded here
2025-08-19 11:13:29 UTC ya make is running...
🟢 2025-08-19 11:13:34 UTC Tests successful.

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-08-19 11:13:40 UTC Build successful.

@ydbot
Copy link
Collaborator

ydbot commented Aug 19, 2025

🔄 New commits pushed — @lopatinevgeny please take a look.

@github-actions
Copy link

github-actions bot commented Aug 19, 2025

2025-08-19 11:11:48 UTC Pre-commit check linux-x86_64-relwithdebinfo for 667e712 has started.
2025-08-19 11:12:04 UTC Artifacts will be uploaded here
2025-08-19 11:14:26 UTC ya make is running...
🟢 2025-08-19 11:14:32 UTC Tests successful.

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-08-19 11:14:38 UTC Build successful.

@github-actions
Copy link

✅ Documentation build

Revision built successfully
Revision preview link

Build logs

Warnings (1)

⚠️ en/concepts/query_execution.md: 58: MD022 / blanks-around-headings Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Retries"]

@ydbot
Copy link
Collaborator

ydbot commented Aug 19, 2025

🔄 New commits pushed — @lopatinevgeny please take a look.

@ydbot
Copy link
Collaborator

ydbot commented Oct 16, 2025

🔄 New commits pushed — @lopatinevgeny please take a look.

@github-actions
Copy link

github-actions bot commented Oct 16, 2025

2025-10-16 04:34:17 UTC Pre-commit check linux-x86_64-relwithdebinfo for 198513a has started.
2025-10-16 04:34:32 UTC Artifacts will be uploaded here
2025-10-16 04:37:17 UTC Check cancelled

@github-actions
Copy link

github-actions bot commented Oct 16, 2025

2025-10-16 04:34:43 UTC Pre-commit check linux-x86_64-release-asan for 198513a has started.
2025-10-16 04:34:57 UTC Artifacts will be uploaded here
2025-10-16 04:37:17 UTC Check cancelled

@ydbot
Copy link
Collaborator

ydbot commented Oct 16, 2025

🔄 New commits pushed — @lopatinevgeny please take a look.

@github-actions
Copy link

github-actions bot commented Oct 16, 2025

2025-10-16 04:38:42 UTC Pre-commit check linux-x86_64-release-asan for b2c9f79 has started.
2025-10-16 04:38:47 UTC Artifacts will be uploaded here
2025-10-16 04:41:21 UTC ya make is running...
🟢 2025-10-16 04:41:28 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-10-16 04:41:32 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Oct 16, 2025

2025-10-16 04:40:36 UTC Pre-commit check linux-x86_64-relwithdebinfo for b2c9f79 has started.
2025-10-16 04:40:50 UTC Artifacts will be uploaded here
2025-10-16 04:43:25 UTC ya make is running...
🟢 2025-10-16 04:43:32 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-10-16 04:43:36 UTC Build successful.

@github-actions
Copy link

✅ Documentation build

Revision built successfully
Revision preview link

@ydbot
Copy link
Collaborator

ydbot commented Oct 17, 2025

Hey @lopatinevgeny, it has been 470 business-hours since the author's last update, could you please review?

Copy link
Member

@fomichev3000 fomichev3000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Текст хороший. Но я бы учел комментарии.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

У нас везде должно быть DataShard и ColumnShard. А на картинке написано Datashard и Columnshard.

Могут ли Compute Tasks запускаться на нодах, которые

  1. Не являются entry point
  2. Не содержат CS, DS?
    Мой ответ -- да. Но это не видно

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно картинку усложнить, я не против, но она все равно схематическая, не думаю что это добавит понимания.

3. **Parsing and Plan Cache Lookup**
On the server side, the {{ ydb-short-name }} node that receives your query first parses and analyzes it for correctness. Before planning execution, {{ ydb-short-name }} checks whether a physical execution plan for this query already exists in the query cache. If a cached plan is found, it can be reused to save time and resources.

4. **Query Optimization and Plan Preparation**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не написано про CBO. Допустим это как бы входит в Query Optimization. Но на самом деле есть очень важный этап получения статистики для CBO, в том числе есть некоторый путь, по которому данные статистики становятся доступными оптимизатору. Этот путь не описан.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Про CBO отдельная статья, да.
Про статистику это требует отдельной статьи, ну либо можно попробовать кратко описать в CBO, т.к. он и есть потребитель.

{{ ydb-short-name }} provides a unified query interface capable of efficiently handling diverse workloads — from high-throughput [Online Transaction Processing (OLTP)](https://en.wikipedia.org/wiki/Online_transaction_processing) to large-scale analytical [Online Analytical Processing (OLAP)](https://en.wikipedia.org/wiki/Online_analytical_processing) queries. With this approach, applications can run transactional and analytical queries transparently, without having to use different APIs for different workloads.

{{ ydb-short-name }} uses a distributed query execution engine designed for high scalability and efficiency in large, distributed environments. When you run a query, {{ ydb-short-name }} automatically breaks the work down across multiple nodes, taking advantage of data locality — processing data where it is stored whenever possible. This reduces unnecessary data movement across the network. Additionally, {{ ydb-short-name }} leverages advanced features like compute pushdown, where filters and computations are pushed closer to the data storage layer, further improving performance. These techniques enable {{ ydb-short-name }} to efficiently handle complex queries and large workloads across clusters of machines.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я бы добавил еще один раздел про физику. Пункты, которые я бы хотел покрыть

  1. У нас используется gRPC, а значит по одному tcp соединению параллельно могут идти и идут несколько сессий, а значит несколько транзакций. Это достаточно сильно отличается от, например, Postgres, поэтому стоит покрыть
  2. Запрос внутри сервера порождает несколько акторов, но не порождает процесс ОС. Поэтому мы можем поддерживать большое количество inflight запросов, сильное большее, чем традиционные бд
  3. Я бы написал про балансировку. То есть клиентские сессии автоматически распределены по узлам кластера. Это опять же очень важное свойство, если оно описано где-то в другом месте, я бы сослался не него. Читатель может не понимать, что на уровне сессий и tcp-соединений есть балансировка

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кроме балансировки сессий, мне кажется то что ты предлагаешь лежит где-то не в области query processing. Статья ведь про выполнение запросов, тонкости TPC и актор-системы тут вряд ли добавят читаемости, другой уровень абстракции.

Про балансировку упомянуто, можно немного расширить.


Result sets in {{ ydb-short-name }} can be arbitrarily large. To efficiently handle large amounts of data, {{ ydb-short-name }} streams result sets back to the client in parts (chunks). This streaming approach lets clients begin processing the results right away without waiting for the entire result set to be transferred. As a result, applications can handle large datasets quickly and with minimal memory usage.

## Limitations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я бы добавил про отсутствие checkpoints. Из-за этого долгие запросы могут не добежать до конца в случае рестартов нод.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Про какие checkpoints речь? Под этим термином очень разные вещи могут пониматься, и тут странно писать по то что их нет.

Наверное лучше сформулировать и именно в терминах error handling, что наши текущие механизмы error handling не позволяют продолжить выполнение запросов при рестартах нод, поэтому длинные запросы могут страдать на рестартах?

@ydbot
Copy link
Collaborator

ydbot commented Oct 20, 2025

🔄 New commits pushed — @lopatinevgeny please take a look.

@github-actions
Copy link

github-actions bot commented Oct 20, 2025

2025-10-20 10:54:50 UTC Pre-commit check linux-x86_64-relwithdebinfo for 3d61187 has started.
2025-10-20 10:55:06 UTC Artifacts will be uploaded here
2025-10-20 10:57:43 UTC ya make is running...
🟢 2025-10-20 10:57:50 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-10-20 10:57:54 UTC Build successful.

@github-actions
Copy link

github-actions bot commented Oct 20, 2025

2025-10-20 10:54:52 UTC Pre-commit check linux-x86_64-release-asan for 3d61187 has started.
2025-10-20 10:55:07 UTC Artifacts will be uploaded here
2025-10-20 10:57:41 UTC ya make is running...
🟢 2025-10-20 10:57:48 UTC Tests successful.

Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
0 0 0 0 0 0

🟢 2025-10-20 10:57:52 UTC Build successful.

@github-actions
Copy link

✅ Documentation build

Revision built successfully
Revision preview link

@orange13 orange13 dismissed stale reviews from lopatinevgeny and blinkov October 24, 2025 12:23

fixed

@orange13 orange13 merged commit 741b5df into ydb-platform:main Oct 24, 2025
17 checks passed
@orange13
Copy link
Contributor

/backport

github-actions bot pushed a commit that referenced this pull request Oct 27, 2025
Co-authored-by: Ivan Blinkov <[email protected]>
Co-authored-by: orange13 <[email protected]>
(cherry picked from commit 741b5df)
@github-actions
Copy link

Successfully created backport PR for stable-25-2:

github-actions bot pushed a commit that referenced this pull request Oct 27, 2025
Co-authored-by: Ivan Blinkov <[email protected]>
Co-authored-by: orange13 <[email protected]>
(cherry picked from commit 741b5df)
@github-actions
Copy link

Successfully created backport PR for stable-25-3:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/stable-25-2 backport/stable-25-3 documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants